import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -05 -15
 * Time: 16:20
 */

public class Main {
    public static void main(String[] args) {
        Shape [] p = new Shape[]{
                new Circle(4),
                new Rectangle(10,1),
                new Polyxy(new double[]{1,5,4,6})
        };
        Arrays.sort(p,(a,b) -> (int)(a.getPerim()-b.getPerim()) );
        for(int i = 0;i < p.length;i++) {
            System.out.println(p[i].getPerim());
        }
    }
}

